
address.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <main_>:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main_()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd010 	sub	sp, sp, #16
	unsigned int address;
	int *p,  num = 123;
   c:	e3a0307b 	mov	r3, #123	; 0x7b
  10:	e50b3010 	str	r3, [fp, #-16] ; num = 123

	p = &num;
  14:	e24b3010 	sub	r3, fp, #16 ; r3 = fp - 16, num address
  18:	e50b3008 	str	r3, [fp, #-8] ; [fp-8] = p = &num
	address = (unsigned int)p;
  1c:	e51b3008 	ldr	r3, [fp, #-8] ; p ---> num variable address
  20:	e50b300c 	str	r3, [fp, #-12] ; address ---> num variable address

	printf("address = 0x%x\n  *p = %d\n  p = %p\n", address, *p, p); // 0xbffc9784  123   0xbffc9784
  24:	e51b3008 	ldr	r3, [fp, #-8]   ; r3 = p = &num     指向变量地址        
  28:	e5932000 	ldr	r2, [r3]        ; r2 = num = 123    取变量值
  2c:	e51b3008 	ldr	r3, [fp, #-8]   ; r3 = p = &num    
  30:	e51b100c 	ldr	r1, [fp, #-12]  ; r1 = address, num variable address
  34:	e59f002c 	ldr	r0, [pc, #44]	; 68 <main_+0x68> parameter
  38:	ebfffffe 	bl	0 <printf>
	printf("\n");
  3c:	e3a0000a 	mov	r0, #10
  40:	ebfffffe 	bl	0 <putchar>
	printf("num = 0x%x\n  num-p = %p\n  \n", &num, &num);
  44:	e24b2010 	sub	r2, fp, #16     ; r2 = num self address
  48:	e24b3010 	sub	r3, fp, #16     ; r3 = num self address
  4c:	e1a01003 	mov	r1, r3          ; r1 = num self address
  50:	e59f0014 	ldr	r0, [pc, #20]	; 6c <main_+0x6c>
  54:	ebfffffe 	bl	0 <printf>

	return 0;
  58:	e3a03000 	mov	r3, #0
}
  5c:	e1a00003 	mov	r0, r3
  60:	e24bd004 	sub	sp, fp, #4
  64:	e8bd8800 	pop	{fp, pc}
  68:	00000000 	.word	0x00000000
  6c:	00000024 	.word	0x00000024

00000070 <p>:


void p(int ** src, int * des)
{
  70:	e92d4800 	push	{fp, lr}
  74:	e28db004 	add	fp, sp, #4
  78:	e24dd010 	sub	sp, sp, #16
  7c:	e50b0008 	str	r0, [fp, #-8] ; src
  80:	e50b100c 	str	r1, [fp, #-12] ; des
        ;;                                      r0    r1     r2    r3       sp
  printf("[%p : %p : %p : %p] src *src **src &src\n", src, * src, ** src, & src);
  84:	e51b1008 	ldr	r1, [fp, #-8] ; r1 = [fp-8] = src, 一级指针地址
        
  88:	e51b3008 	ldr	r3, [fp, #-8] ; r3 = [fp-8] = src
  8c:	e5932000 	ldr	r2, [r3]      ; r2 = [src] = *s    一级指针地址指向的地址，即变量地址
        
  90:	e51b3008 	ldr	r3, [fp, #-8] ; r3 = [fp-8] = src
  94:	e5933000 	ldr	r3, [r3]      ; r3 = [src] = *s
  98:	e5930000 	ldr	r0, [r3]      ; r0 = [src] = **s 一级指针地址指向的变量地址上的值，即变量值
        
  9c:	e24b3008 	sub	r3, fp, #8    ; r3 = fp - 8
  a0:	e58d3000 	str	r3, [sp]      ; [sp] = r3   self address
        
  a4:	e1a03000 	mov	r3, r0        ; r3 = [src]
  a8:	e59f0044 	ldr	r0, [pc, #68]	; f4 <p+0x84>   parameter
  ac:	ebfffffe 	bl	0 <printf>
  printf("[%p:%p:%p] des *des &des\n", des, * des, & des);
  b0:	e51b100c 	ldr	r1, [fp, #-12] ; r1 = des           指向变量的地址
  b4:	e51b300c 	ldr	r3, [fp, #-12] ; r3 = des
  b8:	e5932000 	ldr	r2, [r3]       ; r2 = [des] = *des  取变量值
        
  bc:	e24b300c 	sub	r3, fp, #12    ; r3 = fp-12         即自身的地址
  c0:	e59f0030 	ldr	r0, [pc, #48]	; f8 <p+0x88>
  c4:	ebfffffe 	bl	0 <printf>

  des = * src;
  c8:	e51b3008 	ldr	r3, [fp, #-8] ; r3 = [fp-8] = src   一级指针地址
  cc:	e5933000 	ldr	r3, [r3]      ; r3 = [r3] = *src    一级指针地址指向的地址，即变量地址
  d0:	e50b300c 	str	r3, [fp, #-12]  ; des = *src
  printf("[%p:%p:%p] des *des &des\n", des, * des, & des);
  d4:	e51b100c 	ldr	r1, [fp, #-12]  ; r1 = [fp-12] = des    variable address
  d8:	e51b300c 	ldr	r3, [fp, #-12]  ; r3 = [fp-12] = des    variable address
  dc:	e5932000 	ldr	r2, [r3]        ; r2 = *des             variable value
  e0:	e24b300c 	sub	r3, fp, #12     ; r3 = fp-12            pointer self address
  e4:	e59f000c 	ldr	r0, [pc, #12]	; f8 <p+0x88>
  e8:	ebfffffe 	bl	0 <printf>
}
  ec:	e24bd004 	sub	sp, fp, #4
  f0:	e8bd8800 	pop	{fp, pc}
  f4:	00000040 	.word	0x00000040
  f8:	0000006c 	.word	0x0000006c

000000fc <main>:

int main()
{
  fc:	e92d4800 	push	{fp, lr}
 100:	e28db004 	add	fp, sp, #4
 104:	e24dd018 	sub	sp, sp, #24
  int i = 8, j = 9;
 108:	e3a03008 	mov	r3, #8
 10c:	e50b300c 	str	r3, [fp, #-12] ; i = 8
 110:	e3a03009 	mov	r3, #9
 114:	e50b3008 	str	r3, [fp, #-8] ; j = 9, this fp-8 is j's address 
  int ** shuan, * dan;
  
  i = j = 11;
 118:	e3a0300b 	mov	r3, #11         ; r3 = 1
 11c:	e50b3008 	str	r3, [fp, #-8]   ; j = 11
 120:	e51b3008 	ldr	r3, [fp, #-8]   ; r3 = [fp-8]
 124:	e50b300c 	str	r3, [fp, #-12]  ; [fp-12]=i=[fp-8]=11
  printf("%d %d %d\n", 0 % 10, i, j);
 128:	e51b200c 	ldr	r2, [fp, #-12] ; r2 = i
 12c:	e51b3008 	ldr	r3, [fp, #-8]  ; r3 = j
 130:	e3a01000 	mov	r1, #0         ; r1 = 0
 134:	e59f0088 	ldr	r0, [pc, #136]	; 1c4 <main+0xc8>
 138:	ebfffffe 	bl	0 <printf>

  dan = & i;
 13c:	e24b300c 	sub	r3, fp, #12    ; r3 = fp - 12, this is i's address
 140:	e50b3014 	str	r3, [fp, #-20]	; 0xffffffec, [fp-20] = i's address, fp-20 is dan's address
  shuan = & dan;
 144:	e24b3014 	sub	r3, fp, #20 ; r3 = fp-20, dan pointer address
 148:	e50b3010 	str	r3, [fp, #-16] ; [fp-16]=dan pointer address, fp-16 is shuan's address

  printf("[%p : %p] i &i\n", i, &i);
 14c:	e51b300c 	ldr	r3, [fp, #-12] ; r3 = i = 8
 150:	e24b200c 	sub	r2, fp, #12    ; r2 = fp-12 = i address
 154:	e1a01003 	mov	r1, r3         ; r1 = i = 8
 158:	e59f0068 	ldr	r0, [pc, #104]	; 1c8 <main+0xcc>
 15c:	ebfffffe 	bl	0 <printf>
  printf("[%p: %p : %p] dan *dan &dan\n", dan , * dan, & dan);
 160:	e51b1014 	ldr	r1, [fp, #-20]	; 0xffffffec    r1 = [fp-20] = i's address
 164:	e51b3014 	ldr	r3, [fp, #-20]	; 0xffffffec    r3 = [fp-20] = i's address
 168:	e5932000 	ldr	r2, [r3]        ; r2 = [dan] = *dan = i
 16c:	e24b3014 	sub	r3, fp, #20     ; r3 = fp - 20, dan's self address
 170:	e59f0054 	ldr	r0, [pc, #84]	; 1cc <main+0xd0>
 174:	ebfffffe 	bl	0 <printf>
  printf("[%p : %p : %p : %p] shuan *shuan **shuan &shuan\n", shuan, * shuan, ** shuan, & shuan);
 178:	e51b1010 	ldr	r1, [fp, #-16] ; r1=[fp-16]=shuan=dan's address
 17c:	e51b3010 	ldr	r3, [fp, #-16] ; r3=[fp-16]=shuan=dan's address
 180:	e5932000 	ldr	r2, [r3]       ; r2 = [shuan]=*shuan=&i
        
 184:	e51b3010 	ldr	r3, [fp, #-16] ; r3=[fp-16]=shuan=dan's address
 188:	e5933000 	ldr	r3, [r3]       ; r3=[shuang]=*shuang=&i
 18c:	e5930000 	ldr	r0, [r3]       ; r0=[*shuang]=**shuang=i
        
 190:	e24b3010 	sub	r3, fp, #16 ; r3 = fp-16, shuan self address
 194:	e58d3000 	str	r3, [sp]    ; [sp] = &shuang
 198:	e1a03000 	mov	r3, r0      ; r3 = i
 19c:	e59f002c 	ldr	r0, [pc, #44]	; 1d0 <main+0xd4>
 1a0:	ebfffffe 	bl	0 <printf>

  p(shuan, dan);
 1a4:	e51b3010 	ldr	r3, [fp, #-16] ; r3 = [fp-16] = shuan = &dan
 1a8:	e51b2014 	ldr	r2, [fp, #-20]	; 0xffffffec r2 = [fp-20] = dan = &i
 1ac:	e1a01002 	mov	r1, r2
 1b0:	e1a00003 	mov	r0, r3
 1b4:	ebfffffe 	bl	70 <p>
}
 1b8:	e1a00003 	mov	r0, r3
 1bc:	e24bd004 	sub	sp, fp, #4
 1c0:	e8bd8800 	pop	{fp, pc}
 1c4:	00000088 	.word	0x00000088
 1c8:	00000094 	.word	0x00000094
 1cc:	000000a4 	.word	0x000000a4
 1d0:	000000c4 	.word	0x000000c4
